libxl: handle null lists in libxl_string_list_length
authorMatthew Daley <mattjd@gmail.com>
Fri, 27 Sep 2013 11:29:10 +0000 (23:29 +1200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 3 Oct 2013 12:37:17 +0000 (13:37 +0100)
commita7fa7a4fd6b94c2ace19774ba4ba9f0185c2f2c1
treeb51a5d3e1844ad20c19dae4b5906e7e3ee808462
parentca145fe70bad3a25ad54c6ded1ef237e45a2311e
libxl: handle null lists in libxl_string_list_length

After commit b0be2b12 ("libxl: fix libxl_string_list_length and its only
caller") libxl_string_list_length no longer handles null (empty) lists. Fix
so they are handled, returning length 0.

While at it, remove the unneccessary undereferenced null pointer check
and tidy the layout of the function.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c